namespace Cos.Core.NHibernate.Mapping
{
    using FluentNHibernate.Mapping;

    public class AdminUserMap : ClassMap<AdminUserDataModel>
    {
        public AdminUserMap()
        {
            this.Table("AdminUser");
            this.LazyLoad();
            this.Id(x => x.Id).GeneratedBy.Native().Column("UserID");
            
            this.Map(x => x.UserPwd).Not.Nullable().Column("UserPwd").Length(64);
            this.Map(x => x.UserFirstName).Length(256);
            this.Map(x => x.UserLastName).Length(256);
            this.Map(x => x.UserEmail).Length(1024);
            this.Map(x => x.NavId);

            this.Map(x => x.AccountId).Not.Nullable().Column("AccountID");
            this.Map(x => x.RoleReferenceId).Column("UserRoleID");
            this.Map(x => x.CultureCode).Column("CultureCode");
        }
    }
}